package com.baiyang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class UserController {

  @GetMapping("/login")
  public String  login(){
    return "login";
  }

  @PostMapping("/login")
  public String  index(String username,String password){
    System.out.println("username = " + username);
    System.out.println("password = " + password);
    if("baiyang".equals(username)&&"123456".equals(password)){
      return "redirect:/toIndex";
    }else{
      return "login";
    }

  }

  @GetMapping("/toIndex")
  public String  toIndex(){
    return "index";
  }

  @RequestMapping("/fontawesome")
  public String fontawesome(){
    return "fontawesome";
  }

  @RequestMapping("/index_alt")
  public String index_alt(){
    return "index_alt";
  }








}


